git cookbook
If you follow along with actual files of your own, it will slow you down, but the hands on experience will be worth it.
We are going to learn about :
init, restore, add, commit, log, diff, revert, checkout, stash, merge, branch, push, pull
|
|||
|
consolas Solo developing, multiple features in parallelbranches
after stage "repeat indefinitely" from previous explanation our
options are to (add>)commit or (add>)stash. in case we don't want to commit, we
stash
| ||
|
consolas My own explanations
solo developing, 1 feature at a timeNo branches, no pushing and pulling, only adds and commits and rolling back unwanted changes in every step of the way.
git is aware of these files but they are untracked. rolling back untracked changesrolling back a commit or commitsrevert in current branchrevert in new branch |
||
|
|
||||
|
consolas Upload project to github and make contributions to it (no collaboration).
>git init . If you already have files there, git will complain that the directory is not empty. Easiest solution I found was to move them, clone, and bring them back, unfortunately. Or >gh repo clone <user>/<repo> >git push
View diff between local and remote (to track your changes)
|
|||
|
consolas Collaboration (not including fork)
Take all you learned from the other recipes and just add >git pull from time to time to get the code other people wrote.
This section is under-researched so I wouldn't listen to me. There are probably conventions on merging branches to main which I'm not familiar enough with yet.
Contribute to a repository (fork)
Need to write this recipe
https://docs.github.com/en/get-started/quickstart/fork-a-repo
| |||
|
||||
|
|
|||
|
Created with OneNote.